/**
 *  *2010-7-19 上午12:00:28  add 
 */
package com.base.myproject.client.Excel;


/**
 * @author Administrator
 *2010-7-19
 * javazgw@gmail.com
 */
public class DownExcelDialog {
	static DownExcelDialog ded=null;
	private DownExcelDialog()
	{
		
	}
	
	public static DownExcelDialog getInstance()
	{
		if(ded==null)
			ded = new DownExcelDialog();
		return ded;
	}
	
	public native void javascript(ExcelObject eo)/*-{
		
//		alert(eo.@com.base.myproject.client.Excel.ExcelObject::getheadersize()());
//			alert( eo.@com.base.myproject.client.Excel.ExcelObject::getheader(I)(2));
	 	var xls = new $wnd.ActiveXObject("Excel.Application");
		xls.visible = true;
   		xls.Workbooks.Add;
   		var hearsize = eo.@com.base.myproject.client.Excel.ExcelObject::getheadersize()();
   		var rowcount = eo.@com.base.myproject.client.Excel.ExcelObject::getRowcount()();
   		//alert( hearsize);
   		for( i=0;i<hearsize;i++)
   		{
   			xls.Cells(1, i+1).Value = eo.@com.base.myproject.client.Excel.ExcelObject::getheader(I)(i);
   			 //xls.Cells( 1, i+1).Value = "y[j].innerText";
   		}
   		for( k=0;k<rowcount;k++)
   		{
   		 for (i = 0; i < hearsize; i++)
   		 {
   		 	xls.Cells( k+2, i+1).Value =eo.@com.base.myproject.client.Excel.ExcelObject::getData(II)(k,i);
   		 }
   		}
		}-*/;
}
